//
//  LJCMusicListTableViewCell.m
//  WZLProduct
//
//  Created by 陆静聪 on 16/3/22.
//  Copyright © 2016年 HaiTeng. All rights reserved.
//

#import "LJCMusicListTableViewCell.h"

@interface LJCMusicListTableViewCell ()

@property (nonatomic, retain) UILabel *nameLabel;
@property (nonatomic, retain) UILabel *authorLabel;

@end

@implementation LJCMusicListTableViewCell

- (void)setMusicModel:(LJCMusicModel *)musicModel {
    if (_musicModel != musicModel) {
        _musicModel = musicModel;
    }
    [self giveData];
    
}

- (void)giveData {
    _nameLabel.text = _musicModel.title;
    _authorLabel.text = _musicModel.uname;
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor clearColor];
        self.backgroundColor = [UIColor clearColor];
        [self createCell];
    }
    return self;
}

- (void)createCell {
    _nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLabel];
    _nameLabel.textColor = [UIColor whiteColor];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.top.offset(10);
        make.right.offset(0);
        make.height.mas_equalTo(30);
    }];
    
    _authorLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_authorLabel];
    _authorLabel.textColor = [UIColor whiteColor];
    [_authorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.top.equalTo(_nameLabel.mas_bottom).offset(5);
        make.right.offset(0);
        make.height.mas_equalTo(20);
    }];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
